"""通过爬虫获取百度的信息"""

import requests


def get_html_text(url):
    try:
        response = requests.get(url)
        response.raise_for_status()
        response.encoding = 'utf-8'
        return response.text
    except:
        return ""
    

baidu_url = 'http://www.baidu.com'
result = get_html_text(baidu_url)

print(result)

